package com.DHH.Service.Base.Impl;
import com.DHH.Entity.Base.BaseLoginRecord;
import com.DHH.Mapper.Base.BaseLoginRecordMapper;
import com.DHH.Service.Base.IBaseLoginRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BaseLoginRecordServiceImpl implements IBaseLoginRecordService{
	
	@Autowired
    private BaseLoginRecordMapper baseLoginRecordMapper;
    
   @Override
   public BaseLoginRecord insertBaseLoginRecord(BaseLoginRecord baseLoginRecord){
	   
        baseLoginRecordMapper.insertSelective(baseLoginRecord);
	   return baseLoginRecord;
	   
   };
   @Override
   public BaseLoginRecord updateBaseLoginRecord(BaseLoginRecord baseLoginRecord){
	     baseLoginRecordMapper.updateByPrimaryKeySelective(baseLoginRecord);
        return baseLoginRecord;
   };
   @Override
   public BaseLoginRecord deleteBaseLoginRecord(BaseLoginRecord baseLoginRecord){

	     baseLoginRecordMapper.delete(baseLoginRecord);
        return baseLoginRecord;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public BaseLoginRecord saveOrUpdateBaseLoginRecord(BaseLoginRecord baseLoginRecord){
        if(baseLoginRecord.getId()==null)
        {
            baseLoginRecordMapper.insertSelective(baseLoginRecord);
        }else{
            baseLoginRecordMapper.updateByPrimaryKeySelective(baseLoginRecord);
        }
        return baseLoginRecord;
    };
}
